package com.example.getdata.controller;

import com.example.getdata.task.RyTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("opt")
public class OptController {
    @Autowired
    private RyTask ryTask;

    @GetMapping("/open")
    public String openService() throws Exception {
        ryTask.getdata();
        return "获取数据成功";
    }
    @GetMapping("/close")
    public String closeService() throws Exception {
        ryTask.senddata();
        return "发送数据成功";
    }
}
